import importPlugin from "eslint-plugin-import";

export default [
  {
    plugins: {
      import: importPlugin,
    },
    rules: {
      "import/order": [
        "error",
        {
          groups: ["builtin", "external", "internal", "parent", "sibling", "index"],
          pathGroups: [
            {
              pattern: "pinia",
              group: "external",
              position: "before",
            },
            {
              pattern: "vue",
              group: "external",
              position: "before",
            },
            {
              pattern: "**/use*",
              group: "internal",
              position: "before",
            },
          ],
          pathGroupsExcludedImportTypes: ["vue", "pinia"],
          "newlines-between": "always",
          alphabetize: { order: "asc", caseInsensitive: true },
        },
      ],
    },
  },
];
